<template>
    <div class="xl-table">
        <xlTable
                :columns="columns"
                :dataSource="data"
                rowKey="id"
                :pagination="false"
                :loading="loading"
                bordered
                :scrollX="900">
            >
            <template v-slot:action="scope">
                <a @click="seeForm(scope.record)">查看</a>
            </template>
        </xlTable>
        <xlForm ref="xlForm" @handleOk="handleOk"></xlForm>
        <seeForm ref="seeForm"></seeForm>
    </div>
</template>

<script>
    import xlMixin from '../../../../../components/mixin'

    export default {
        name: "index",
        mixins: [xlMixin],
        data() {
            return {
                columns: [
                    {
                        title: '序号',
                        key: 'rowIndex',
                        align: "center",
                        width: '100px',
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: '案件名称',
                        dataIndex: 'caseName',
                        type: 'input'
                    },
                    {
                        title: '案由类别',
                        dataIndex: 'caseKind',
                        type: 'input'
                    },
                    {
                        title: '案号',
                        dataIndex: 'caseNo',
                        type: 'input'
                    },
                    {
                        title: '公司名称',
                        dataIndex: 'companyName',
                        type: 'input'
                    },
                    {
                        title: '统一识别码',
                        dataIndex: 'creditCode',
                        type: 'input'
                    },
                    {
                        title: '案件身份',
                        dataIndex: 'role',
                        type: 'select',
                        typeData:[
                            {
                                dataName:'原告',
                                dataValue:0
                            },
                            {
                                dataName:'被告',
                                dataValue:1
                            }
                        ]
                    },
                    {
                        title: '来源',
                        dataIndex: 'source',
                        type: 'input'
                    }
                ],
                url: {
                    list: ""
                }

            }
        },
        props: {
            propData: {
                type:Array,
                default:()=>{
                    return []
                }
            }
        },
        watch:{
            propData(){
                this.data = this.propData
            }
        },
        created() {
            this.loading = false
            this.formatMerge()
            this.data = this.propData
        },
        methods: {

        }
    }
</script>

<style scoped lang="less">
    .xl-table {
        .xl-table-content {
            padding: 16px;
        }
    }
</style>
